package com.springboot.cloud.feignservice;

import java.util.List;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.springboot.cloud.entities.Article;

@FeignClient(value = "MICROSERVICE")
public interface ArticleFeignService {
	
	@RequestMapping(value = "/geta/{start}", method = RequestMethod.GET)
	public List<Article> geta(@PathVariable("start") int start);
	
	@RequestMapping(value = "/adda", method = RequestMethod.POST)
	public boolean adda(Article a);

	@RequestMapping(value = "/getone/{id}", method = RequestMethod.GET)
	public Article getone(@PathVariable("id")int id);
	
	@RequestMapping(value = "/getmyarticle/{uid}", method = RequestMethod.GET)
	public List<Article> getmyarticle(@PathVariable(value="uid") int uid);

	@RequestMapping(value = "/getfavorite/{id}", method = RequestMethod.GET)
	public List<Article> getfavorite(@PathVariable(value="id")int id);

	@RequestMapping(value = "/addlike/{id}", method = RequestMethod.GET)
	public boolean addlike(@PathVariable(value="id")int id);
	
	@RequestMapping(value = "/addnolike/{id}", method = RequestMethod.GET)
	public boolean addnolike(@PathVariable(value="id")int id);

	@RequestMapping(value = "/addfavorite/{id}/{aid}", method = RequestMethod.GET)
	public boolean addfavorite(@PathVariable(value="id")int id,@PathVariable(value="aid")int aid);

}
